<?php

abstract class AbstractService
{
    /**
     * @var SzContext
     */
    protected $context;

    /**
     * Construction.
     */
    protected function __construct()
    {
        // initialize application context
        $this->context = SzContextFactory::get();
    }

    /**
     * 处理用户创建时的逻辑
     *
     * @param int $shardId
     * @return void
     */
    abstract public function handleCreate($shardId);

    /**
     * 处理用户登录时的逻辑
     *
     * @param int $shardId
     * @return void
     */
    abstract public function handleLogin($shardId);

    /**
     * 处理 service 对外提供的全量数据
     *
     * @param int $shardId
     * @return mixed
     */
    abstract public function info($shardId);
}